#include <graphics.h>
#include <math.h>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <stdio.h>

using namespace std;

 class BALL
{
      double x;
      double y;
      double a;
      double vx;
      double vy;
      double w;
      double dissw;
      double dissv;
      
    public :
      BALL (double x1,double y1,double vx1,double vy1,double w1,double dissw1,double dissv1)
      {
         x=x1;
         y=y1;
         a=0.069*sqrt(vx1*vx1+vy1*vy1)*w1;
         vx=vx1;
         vy=vy1; 
         w=w1;
         dissw=dissw1;
         dissv=dissv1;
      }
      
      ~BALL(void)
      {
         x=0;
         y=0;    
         a=0;
         vx=0;
         vy=0;
         w=0;
         dissw=0;
         dissw=0;
      }
      
      void FUNCT(void)
      {
        double dt;
        dt=0.1;
        w=w-w/dissw;
        a=0.034*sqrt(vx*vx+vy*vy)*w;
        vx=vx-dt*a*vy/sqrt(vx*vx+vy*vy)-(vx/dissv);
        vy=vy+dt*a*vx/sqrt(vx*vx+vy*vy)-(vy/dissv);
        x=x+(vx*dt);
        y=y+(vy*dt);
      } 
      
      void COLOR(int a, int b)
      {
          setfillstyle(a,b);
          fillellipse((int)x,(int)y, 3, 3);     
      }
                
};
         
int main()
{
    double vx,  vy,   w,   dissw,     dissv;
    cout<<"Nachal'nye dannie:\n";
    cout<<"Vvedite vx:\n";
    cin>>vx;
    cout<<"Vvedite vy:\n";
    cin>>vy;
    cout<<"Vvedite w:\n";
    cin>>w;
    cout<<"Vvedite dissip w:\n";
    cin>>dissw;
    cout<<"Vvedite dissip v:\n";
    cin>>dissv;
    
 
    initwindow(1366, 768);
    
    moveto(50,300);
     
    BALL B(700,350,vx,vy,w,dissw,dissv);  
        
    while (0==0)
    {

    B.FUNCT();
     
    B.COLOR(1, RED);
               
    } 
    getch();
    closegraph();
    return 0;
}
